#!/usr/bin/env python3
"""
简化的商品API测试
"""
from fastapi import FastAPI, Query
from typing import Optional

app = FastAPI()

@app.get("/test/goods/list")
async def test_goods_list(
    page: int = Query(1, gt=0),
    pageSize: int = Query(10, gt=0, le=100),
    include_specs: bool = Query(False),
    include_sales: bool = Query(False),
    sort: str = Query("default"),
    priceAsc: bool = Query(False),
    salesAsc: bool = Query(False)
):
    """测试商品列表API"""
    return {
        "code": 200,
        "message": "测试成功",
        "data": {
            "list": [],
            "total": 0,
            "page": page,
            "pageSize": pageSize,
            "params": {
                "include_specs": include_specs,
                "include_sales": include_sales,
                "sort": sort,
                "priceAsc": priceAsc,
                "salesAsc": salesAsc
            }
        }
    }

if __name__ == "__main__":
    import uvicorn
    uvicorn.run(app, host="127.0.0.1", port=8001)
